﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NDimArrayNamespace;

namespace QLabValues
{
    // TODO: implement QStructValueNDimArray
    // HINT: all QStructValues must have same fields!
    public class QStructValueNDimArray : NDimArrayNamespace.NDimArray<QStructValue>, QLabValues.IQLabValue
    {
        public QStructValueNDimArray(params int[] dimensionSize)
            : base(dimensionSize)
        {
        }
        public QStructValueNDimArray(QStructValue[] data, params int[] dimensionSize)
            : base(data, dimensionSize)
        {
        }

        public object Clone()
        {
            return (object)new QStructValueNDimArray(Data, DimensionSize);
        }

        public QStructValueNDimArray(IQLabValue iq)
        {
            // TODO: contructor for Struct value ndim array
        }
        public IQLabValueType GetEnumType()
        {
            return IQLabValueType.QStructValueNDimArray;
        }

        public QStructValueNDimArray GetSubArray(int[][] subNDimArrayCoordinates)
        {
            NDimArray<QStructValue> tempArray = base.GetSubNDimArray(subNDimArrayCoordinates);
            return new QStructValueNDimArray(tempArray.Data, tempArray.DimensionSize);
        }

        public QStructValueNDimArray SubAssignment(QStructValueNDimArray matrix, int[][] subNDimArrayCoordinates)
        {
            NDimArray<QStructValue> tempArray = base.SubscriptedAssignment(new NDimArray<QStructValue>(matrix.Data, matrix.DimensionSize), subNDimArrayCoordinates);
            return new QStructValueNDimArray(tempArray.Data, tempArray.DimensionSize);
        }
    }
}
